/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Bus_合同分拆",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Order.IServices;
using VOL.Core.ManageUser;
using Newtonsoft.Json;
using VOL.Core.Utilities;

namespace VOL.Order.Controllers
{
    public partial class Bus_合同分拆Controller
    {
        private readonly IBus_合同分拆Service _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public Bus_合同分拆Controller(
            IBus_合同分拆Service service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [HttpPost]
        [Route("GetWaiBaoBanZuBaoGongList")]
        public ActionResult GetWaiBaoBanZuBaoGongList([FromBody]Bus_合同分拆 bus)
        {
            VOL.Core.Services.Logger.Info("1外包根据自己班组获取班组任务,请求:" + JsonConvert.SerializeObject(bus));
            WebResponseContent webResponse = new WebResponseContent();
            var result = _service.GetWaiBaoBanZuBaoGongList(bus);
            VOL.Core.Services.Logger.Info("3外包根据自己班组获取班组任务,结果:" + JsonConvert.SerializeObject(result));
            if (result != null && result.Count > 0)
            {
                webResponse.Code = "0";
                webResponse.Data = result;
            }
            else
            {
                webResponse.Code = "1";
                webResponse.Message = "未查到工单";
            }
            VOL.Core.Services.Logger.Info("3外包根据自己班组获取班组任务,返回值:" + JsonConvert.SerializeObject(webResponse));
            return Json(webResponse);
        }
    }
}
